#include <iostream>
#include <array>
#include <algorithm>

using namespace std;

int main() {
    array<int, 1001> arr {0};
    for (auto a = 1; a < 1000; ++a) {
        for (auto b = a; b < 1000; ++b) {
            for (auto c = b + 1; c < 1000; ++c) {
                auto p = a + b + c;
                if (p > 1000)
                    break;
                if (a + b > c && a * a + b * b == c * c) 
                    ++arr[p];
            }
        }
    }
    cout << distance(arr.begin(), max_element(arr.begin(), arr.end())) << endl;
}